@import '../../customWidget/src/component/common/closeBtn';
@import '../../customWidget/src/component/common/transparentBtn';
@import '../../customWidget/src/component/common/textPill';
@import '../../customWidget/src/component/common/userPill';
@import '../../customWidget/src/component/common/buttonAdd';
@import './dropdown';

.customContentBox {
  box-sizing: border-box;
  width: 100%;
  border-right: 1px solid #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
  background: #fff;

  .flexRow .flex {
    max-width: 100%;
    box-sizing: border-box;
  }
}
.detailControlName {
  padding-left: 14px !important;
  position: relative;
  &.required {
    &:before {
      content: '*';
      position: absolute;
      left: 4px;
      top: 7px;
      font-size: 16px;
      color: #888;
    }
    &.error {
      color: #fe423f;
    }
  }
}
.customRowBox {
  > .flex {
    border-top: 1px solid #e0e0e0;
    border-left: 1px solid #e0e0e0;
    padding: 5px 10px;
    padding-left: 6px;
  }
  .maxFullWidth {
    max-width: 100%;
  }
  .flexRow {
    position: relative;
  }
  .validationError {
    position: absolute;
    bottom: 100%;
    left: -10px;
    border-radius: 3px;
    color: #fff;
    padding: 5px 20px;
    transform: translateY(-5px);
    z-index: 100;
    white-space: nowrap;
    background: #f44336;
  }
  .validationErrorArrow {
    position: absolute;
    left: 0;
    bottom: 100%;
    background: transparent;
    border-width: 6px;
    border-style: solid;
    border-left-color: transparent;
    border-right-color: transparent;
    border-bottom-color: transparent;
    border-top-color: #f44336;
    z-index: 100;
    transform: translateY(-5px);
    margin-bottom: -11px;
  }
  .customFieldsLabel {
    flex: 36;
    height: 30px;
    line-height: 31px;
    font-size: 13px;
    color: #888;
    margin-right: 8px;
    padding-left: 8px;
    position: relative;
    &.required {
      &:before {
        content: '*';
        position: absolute;
        left: 0;
        top: 4px;
        font-size: 16px;
      }
      &.error {
        color: #fe423f;
      }
    }
  }
  .locationLayerContainer {
    width: 100%;
  }
  .customFieldsBox {
    flex: 64;
    position: relative;
    .custom-autofill {
      display: none;
      list-style-type: none;
      margin: 0;
      padding: 0;
      background-color: #fff;
      position: absolute;
      left: 0;
      top: 100%;
      z-index: 100;
      width: 120px;
      border: solid 1px #e5e5e5;
      &.show {
        display: block;
      }
      & > li {
        display: block;
        font-size: 13px;
        line-height: 24px;
        padding: 0 6px;
        height: 24px;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        user-select: none;
        cursor: pointer;
        &:hover,
        &.active {
          background-color: #e5e5e5;
        }
      }
    }
    .customText {
      width: 100%;
      padding: 5px 4px;
      height: 30px;
      font-size: 13px;
      border-radius: 3px;
      box-sizing: border-box;
      border: none;
    }
    .customFieldsTime,
    .customLocation {
      cursor: pointer;
    }
    .customTextarea {
      width: 100%;
      padding: 3px 4px;
      line-height: 24px;
      font-size: 13px;
      border-radius: 3px;
      box-sizing: border-box;
      resize: none;
      border: none;
      vertical-align: top;
    }
    .customTextareaEdit {
      cursor: text;
    }
    div.customTextarea {
      min-height: 27px;
      word-break: break-all;
      white-space: pre-line;
      & > a:hover {
        text-decoration: underline;
      }
    }
    .customFieldsNumberBox {
      left: 0;
      right: 0;
      position: absolute !important;
    }
    td {
      .customFieldsNumberBox {
        position: relative !important;
      }
    }
    .customRemark,
    .moneyCn {
      width: 100%;
      padding: 2px 4px;
      border-width: 1px;
      line-height: 24px;
      min-height: 24px;
      font-size: 13px;
      box-sizing: border-box;
      color: #757575;
      cursor: default;
    }
    .customUserList,
    .customGroupList {
      position: relative;
      padding: 0 4px;
      .text {
        display: inline-block;
        padding: 2px 4px;
        font-size: 13px;
        line-height: 26px;
      }
    }
    .customRadio {
      display: inline-block;
      height: 30px;
      line-height: 30px;
      margin-right: 15px;
      cursor: pointer;
      &:not(.customChecked) {
        .customRadioIcon {
          border-color: #ccc !important;
          i {
            background: #fff !important;
          }
        }
      }
    }
    .customRadioIcon {
      width: 8px;
      height: 8px;
      border-radius: 100%;
      border-style: solid;
      border-width: 1px;
      padding: 2px;
      font-size: 0;
      margin-right: 5px;
      display: inline-block;
      vertical-align: top;
      margin-top: 7px;
      box-sizing: initial;
      i {
        width: 8px;
        height: 8px;
        display: inline-block;
        border-radius: 100%;
        vertical-align: top;
      }
    }
    .customRadioTitle {
      width: 82px;
      display: inline-block;
      vertical-align: top;
      height: 30px;
      .maxFullWidth {
        height: 30px;
      }
    }
    .customCheckox {
      display: inline-block;
      height: 30px;
      line-height: 30px;
      margin-right: 15px;
      cursor: pointer;
      &:not(.customChecked) {
        .customCheckoxIcon {
          border-color: #ccc !important;
          background: #fff !important;
        }
      }
    }
    .customCheckoxIcon {
      width: 12px;
      height: 12px;
      border-radius: 1px;
      border-style: solid;
      border-width: 1px;
      font-size: 12px;
      margin-right: 5px;
      display: inline-block;
      vertical-align: top;
      margin-top: 7px;
      box-sizing: initial;
      i {
        display: inline-block;
        vertical-align: top;
        color: #fff;
      }
    }
    .maxTipWidth:after {
      word-break: break-all;
      white-space: normal;
      width: 150px;
    }
    .customDropdownBox {
      width: 100%;
      padding: 5px 10px 5px 10px;
      box-sizing: border-box;
      height: 30px;
      position: relative;
      cursor: pointer;
      &.empty {
        color: #9e9e9e;
      }
      .customDropdownName {
        display: inline-block;
        max-width: 120px;
        font-size: 13px;
        vertical-align: top;
      }
      .icon-arrow-down-border {
        font-size: 12px;
        margin-left: 2px;
      }
      .customDropdownList {
        position: absolute;
        top: 30px;
        right: 0;
        left: 0;
        background: #fff;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.13);
        z-index: 100;
        padding: 5px 0;
        border-radius: 3px;
        max-height: 190px;
        overflow: hidden;
        overflow-y: auto;
        li {
          height: 30px;
          line-height: 30px;
          padding: 0 10px;
          box-sizing: border-box;
          width: 100%;
          &:hover {
            color: #fff;
          }
          &:not(:hover) {
            background: #fff !important;
          }
        }
        li:not(.Hidden) {
          display: inline-block;
        }
        .customDropdownClear {
          color: #9e9e9e;
          border-bottom: 1px solid #e0e0e0;
        }
      }
    }
    .customAttachment {
      height: 30px;
      line-height: 30px;
      .attachmentPrograss {
        width: 200px;
        background: #f0f0f0;
        border-radius: 10px;
        height: 5px;
        margin-top: 17px;
        margin-right: 5px;
        display: inline-block;
        vertical-align: top;
        .currentPrograss {
          background: #ddd;
          width: 0;
          height: 5px;
          border-radius: 10px;
        }
      }
    }
    .customAttachmentMsg {
      color: #999;
    }
    .attachmentsList {
      margin-top: 10px;
    }
    .customAttachmentMain {
      width: 100%;
      box-sizing: border-box;
      padding: 0 10px 10px 0;
      background: #f5f5f5;
      margin-bottom: 10px;
      margin-top: 5px;
      position: relative;
      &:before {
        content: '';
        position: absolute;
        width: 0;
        height: 0;
        border-width: 8px;
        border-color: transparent transparent #f5f5f5 transparent;
        top: -16px;
        left: 30px;
        border-style: solid;
      }
      &.customAttachmentMainClear {
        padding: 0;
        background: #fff;
        &:before {
          display: none;
        }
      }
      .customAttachmentCancel:not(:hover) {
        color: #999 !important;
      }
    }
    .customAttachmentBox {
      text-align: right;
      line-height: 28px;
      height: 28px;
      margin-top: 10px;
      span {
        cursor: pointer;
      }
      .customAttachmentConfirm {
        font-size: 13px;
        display: inline-block;
        margin-left: 20px;
        padding: 0 18px;
        text-align: center;
        color: #fff;
        border-radius: 3px;
      }
    }
    .uploadedAttachmentList {
      margin-top: 13px;
    }
    .datetime,
    .datetimeRange {
      font-size: 0;
      min-height: 30px;
      padding: 0 8px;

      &.empty {
        color: #888;
      }

      .mui-datetime,
      .mui-datetimerange {
        width: auto;
      }

      span {
        font-size: 13px;
        line-height: 30px;
        &.pickerText {
          cursor: pointer;
        }
      }

      .timePickerToggle,
      .rangePickerToggle {
        display: inline-block;
        line-height: 30px;
      }

      &.show {
        padding: 0 4px;
        border-color: transparent !important;
        span.pickerText {
          cursor: default;
        }
      }
    }
    .customRelationBox {
      li {
        position: relative;
        height: 40px;
        box-sizing: border-box;
        border: 1px solid #e0e0e0;
        border-radius: 5px;
        margin-bottom: 10px;
        &:first-child {
          margin-top: 5px;
        }
        &:hover {
          .customRelationDel {
            display: inline-block;
          }
        }
        > .flexRow {
          position: absolute;
          top: 0;
          bottom: 0;
          left: 0;
          right: 0;
          line-height: 40px;
          .customRelationIcon {
            color: #8f9093;
            font-size: 18px;
            margin-left: 10px;
            display: inline-block;
            vertical-align: top;
            margin-top: 10px;
            width: 18px;
            min-width: 18px;
            height: 20px;
            &[class*='fileIcon-'] {
              margin-top: 9px;
            }
          }
          .overflow_ellipsis {
            font-size: 13px;
            cursor: pointer;
            &:not(:hover) {
              color: #333 !important;
            }
            &.customRelationDelete {
              color: #f44336 !important;
              cursor: default;
            }
          }
          .circle {
            width: 24px;
            height: 24px;
            margin: 7px 20px 0;
            display: inline-block;
            vertical-align: top;
          }
        }
        .customRelationDel {
          position: absolute;
          right: -8px;
          top: -8px;
          font-size: 16px;
          display: none;
          cursor: pointer;
          &:not(:hover) {
            color: #8f9093 !important;
          }
        }
      }
    }
    .addRelationBtn {
      height: 30px;
      line-height: 30px;
      cursor: pointer;
      font-size: 13px;
      &:not(:hover) {
        color: #888 !important;
      }
      &:not(.Hidden) {
        display: inline-block;
      }
    }
  }
  & > .flex:only-child {
    .customFieldsLabel {
      flex: 18;
    }
    .customFieldsBox {
      flex: 82;
    }
  }
  .customUnits {
    height: 30px;
    line-height: 31px;
    font-size: 13px;
    margin-left: 5px;
    max-width: 55px;
    overflow: hidden;
    white-space: nowrap;
    vertical-align: top;
    text-overflow: ellipsis;
    &:not(.Hidden) {
      display: inline-block;
    }
  }
  .customFieldsNumber {
    height: 30px;
    line-height: 31px;
    font-size: 13px;
    padding-left: 4px;
    display: inline-block;
    vertical-align: top;
    max-width: 110px;
    &.grayColor {
      color: #ccc;
    }
  }
  input.customFieldsNoAuth {
    background: #fff !important;
    color: #757575;
  }

  input::-webkit-input-placeholder {
    color: #ccc;
  }
  input::-ms-input-placeholder {
    color: #ccc;
  }
  input::-moz-placeholder {
    color: #ccc;
  }
  textarea::-webkit-input-placeholder {
    color: #ccc;
  }
  textarea::-ms-input-placeholder {
    color: #ccc;
  }
  textarea::-moz-placeholder {
    color: #ccc;
  }
  .LineScore-item {
    vertical-align: top;
    margin-top: 12px;
  }
  .StarScore-item {
    vertical-align: top;
    margin-top: 7px;
  }
  .customScoreBox .Font14 {
    margin-top: 5px;
    display: inline-block;
    vertical-align: top;
  }
  .customSubsection {
    height: 40px;
    line-height: 40px;
    width: 100%;
    position: relative;
    .customSubsectionName {
      background: #fff;
      position: absolute;
      top: 0;
      bottom: 0;
      right: -1px;
      left: 0;
      border-top: 1px solid #e0e0e0;
      padding-left: 15px;
      box-sizing: border-box;
      font-size: 13px;
      color: #9e9e9e;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      padding-right: 15px;
    }
    &:not(.customSubsectionOa) {
      .customSubsectionName {
        background: #f5f5f5;
      }
    }
  }
  .customSubsectionNull {
    height: 10px !important;
  }
}

.customRowBox.customFieldsNoAuth {
  input,
  textarea {
    background: #fff !important;
  }
  .icon-arrow-down-border {
    display: none;
  }
}

.customDetailBox {
  font-size: 13px;
  width: 100%;
  padding: 15px 30px 20px 30px;
  box-sizing: border-box;
  border-top: 1px solid #e0e0e0;
  border-left: 1px solid #e0e0e0;
  .customDetailMain {
    width: 100%;
    position: relative;
    .customDetailDel {
      position: absolute;
      top: 6px;
      right: 10px;
      cursor: pointer;
      &:not(:hover) {
        color: #bdbdbd !important;
      }
      i {
        margin-right: 4px;
        font-size: 16px;
      }
    }
  }
  table {
    background: #fff;
    border-spacing: 0;
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #dedede;
    tr:nth-child(1) {
      height: 30px;
    }
    tr:nth-child(2) {
      td:first-child {
        width: 130px;
      }
    }
    td {
      border: 1px solid #ccc;
      &:first-child {
        padding: 0 10px;
      }
      input:not(.mui-textinput) {
        border-width: 0 !important;
        padding: 0 4px !important;
        height: 27px !important;
      }
      .customFieldsNumber,
      .customUnits {
        height: 27px !important;
        line-height: 27px !important;
      }
      .customDropdownBox {
        border: 0 !important;
        height: 27px !important;
      }
      textarea {
        border-width: 0 !important;
        vertical-align: top;
        margin-bottom: -1px;
      }
      .customFieldsNumberBox {
        cursor: text !important;
      }

      & > .datetimeRange {
        padding: 0 !important;
        margin: -1px;

        & > .pickerText,
        & > .DatePicker {
          display: inline-block;
          margin-left: 8px;
        }

        table {
          border: none;
          tr {
            border-bottom: solid 1px #ccc;
            &:last-child {
              border-bottom: none;
            }
            td {
              border: none;
              border-right: solid 1px #ccc;
              &:last-child {
                border-right: none;
              }
            }
          }
        }
      }
    }
  }
  .customDetailAddBox {
    text-align: center;
    margin-top: 10px;
  }
  .customDetailAdd {
    cursor: pointer;
  }
  .customResultDetail {
    tr {
      height: 30px;
    }
    tr:nth-child(2) {
      td:first-child {
        width: 130px;
      }
    }
    td {
      border: 1px solid #ccc;
      padding: 0 10px;
    }
  }
  > .validationError {
    margin-bottom: -15px !important;
    left: 0 !important;
  }
  > .validationErrorArrow {
    margin-bottom: -27px !important;
    left: 30 !important;
  }
}

.customSignWidget {
  font-size: 13px;

  & > table {
    width: 100%;
    border: solid 1px #ccc;
    border-collapse: collapse;
    tr {
      border-bottom: solid 1px #ccc;
      &:last-child {
        border-bottom: none;
      }
      td {
        border-right: solid 1px #ccc;
        padding: 4px 10px;
        line-height: 22px;
        height: auto;
        &:first-child {
          width: 130px;
        }
        &:last-child {
          border-right: none;
        }

        .mui-dropdown,
        .mui-datetimerange,
        .mui-textinput,
        .mui-textview {
          width: 100% !important;
        }

        .mui-datetimerange-base {
          .mui-datetime-picker {
            line-height: 24px;
          }
        }
        .mui-textview {
          padding: 2px 0;

          .text-error {
            color: #fe423f;
          }
        }

        .mui-forminput,
        .mui-textview {
          min-height: 20px;
        }

        .mui-forminput,
        .mui-textinput {
          border: none;
          padding: 2px 0;
          &:disabled {
            background-color: transparent;
            cursor: default;
          }
          & > .mui-forminput-label {
            line-height: 20px;
            padding: 0;
          }
        }
      }
    }
  }
}
